<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.yc.comm.Constant"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String strBtsName = request.getParameter("strBtsName");
String strChoosedTableId = request.getParameter("choosedTableId");
String choosedBtsName = request.getParameter("choosedBtsName");
//if(strBtsName != null)
	//strBtsName = new String(strBtsName.getBytes("ISO_8859_1"),"utf-8"); 

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <link rel="stylesheet" type="text/css" href="<%=path%>/js/ext/resources/css/ext-all.css">  
	<link rel="stylesheet" type="text/css" href="<%=path%>/js/ext/resources/css/edit-grid.css">   
	<script type="text/javascript" src="<%=path%>/js/ext/adapter/ext/ext-base.js"></script>
	<script type="text/javascript" src="<%=path%>/js/ext/ext-all.js"></script>
	<script type="text/javascript" src="<%=path%>/js/ext/DWRTreeLoader.js"></script>
	<script type="text/javascript" src="<%=path%>/js/ext/SearchField.js"></script> 
	<script type="text/javascript" src="<%=path%>/js/ext/query-dwr-proxy.js"></script>	
	<script type='text/javascript' src="<%=path%>/dwr/engine.js"></script>
	<script type='text/javascript' src="<%=path%>/dwr/util.js"></script> 
	<script type='text/javascript' src="<%=path%>/dwr/interface/JBTSWeb.js"></script>
    <title>bts</title>  

  </head>
  
<body>
<form id="backForm" method="POST" action="<%=path%>/pages/query/query.jsp">
	<input type="hidden" name="choosedTableId" id="choosedTableId_ID" value="<%=strChoosedTableId%>"/>
	<input type="hidden" name="choosedBtsName" id="choosedBtsName_ID" value="<%=choosedBtsName%>"/>
</form>
<div id="mainTabPanelDIV" style="width:100%;height:100%"></div>
<script>
Ext.onReady(function(){  
	Ext.QuickTips.init();
	
	   var viewport = new Ext.Viewport({
	    layout:'border',
	    frame:true,
	    items:[ 
	    	{
		        region: 'center',
		        contentEl: 'mainTabPanelDIV',
		        margins:'110 30 30 5',
		        split: true,
		        border: true	
		    }]
		});
	
	
	var BTSType = Ext.data.Record.create([								
							   {name: 'id', type: "string"},
							   {name: 'btsname', type: "string"},
							   {name: 'frequency', type: "string"},
							   {name: 'btscode', type: "string"},
							   {name: 'BSC', type: "string"},
							   {name: 'manufacturer', type: "string"},
							   {name: 'cabinet',  type: 'string'},
							   {name: 'primdevicetype', type: "string"},
							   {name: 'btscfg', type: "string"},
							   {name: 'frequencyNum', type: 'string'},
							   {name: 'combinerType', type: 'string'},							
							   {name: 'combinerNum',  type: 'string'},
							   {name: 'primContrmodel',  type: 'string'},
							   {name: 'primContrNum',  type: 'string'},
							   {name: 'powerPanelType',  type: 'string'},
							   {name: 'powerPanelNum',  type: 'string'},
							   {name: 'powerType',  type: 'string'},							   
							   {name: 'ele2Mnum',  type: 'string'},
							   {name: 'registtime',  type: 'date'},
							   {name: 'antennaType',  type: 'string'},
							   {name: 'antennaFac',  type: 'string'},
							   {name: 'antennaNum',  type: 'string'},
							   {name: 'antennaGain',  type: 'string'},
							   {name: 'antennaDirect',  type: 'string'},
							   {name: 'antennaPolar',  type: 'string'},
							   {name: 'antennaHeight',  type: 'string'},
							   {name: 'antennaPre',  type: 'string'},
							   {name: 'antennaAngle',  type: 'string'},
							   {name: 'antennaPitchAngle',  type: 'string'},
							   {name: 'feederType',  type: 'string'},
							   {name: 'other1',  type: 'string'},
							   {name: 'other2',  type: 'string'},							   
							   {name: 'other3',  type: 'string'},
							   {name: 'other4',  type: 'string'},
							   {name: 'IDUType',  type: 'string'},
							   {name: 'IDUNum',  type: 'string'},
							   {name: 'ODUType',  type: 'string'},
							   {name: 'ODUNum',  type: 'string'},
							   {name: 'refreshtime',  type: 'string'},
							   {name: 'memo',  type: 'string'}
						 ]); 
	var BTSCM = new Ext.grid.ColumnModel(
			[	            
				{header: "流水号", sortable: true, dataIndex: 'id',align:'left'},
				{header: "基站编号", sortable: true, dataIndex: 'btscode',align:'left'},
				{header: "基站名称",  sortable: true, dataIndex: 'btsname',align:'left'},	
				{header: "使用频段",  sortable: true, dataIndex: 'frequency',align:'left'},	 	
				{header: "厂家",  sortable: true, dataIndex: 'manufacturer',align:'left'}, 
				{header: "主设备类型",  sortable: true, dataIndex: 'primdevicetype',align:'left'}	
			]
		);
	var BTSDS = new Ext.data.Store({
				proxy: new Ext.data.DWRProxy(JBTSWeb.getBTSNewBOByBtsName, true),	
				reader: new Ext.data.ListRangeReader({
					totalProperty: 'totalSize',
					id: 'id'
				}, BTSType),
				sortInfo:{field:'id', direction:'ASC'}// ������Ϣ
			});		
	var towerMountedGridDiv = Ext.get("mainTabPanelDIV");
	
	var BTSGrid = new Ext.grid.GridPanel({	
			el:'mainTabPanelDIV',
			ds: BTSDS,
			cm: BTSCM,  
			autoWidth : true,  
			autoScroll : true,  
			autoHeight: false,
			region : 'center',
			height: towerMountedGridDiv.getComputedHeight(), 
			minSize: 200,		
			frame:true,
			collapsible:false, 
			enableDragDrop:false, 
			tbar: new Ext.Toolbar(
				[
					{xtype:"tbfill"}, 
					{
			 			text:'返回',
			 			pressed:true,					 
			            handler:function()// 点击按钮执行的操作
			            {
							document.getElementById("backForm").submit();
			            }
			        }
				]),
			
			bbar: new Ext.PagingToolbar({
					pageSize: 17,
					store: BTSDS,
					displayInfo: true,
					displayMsg: '显示第 {0} 条到 {1} 条记录，一共 {2} 条',
					emptyMsg: "没有记录"
				})
		});		
	
	BTSDS.on('beforeload', function() 
	{
		BTSDS.baseParams = {'<%=Constant.BTS_NAME%>':'<%=strBtsName%>'};
	});
	BTSDS.load({params:{start:0,limit:17,'<%=Constant.BTS_NAME%>':'<%=strBtsName%>'}});
	BTSGrid.render();
	
});	
</script>
</body>
</html>
